﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SystemHelperLibrary.WPF.Controls
{
	/// <summary>
	/// Interaction logic for TimeLineControl.xaml
	/// </summary>
	public partial class TimeLineControl : UserControl
	{
		public static DependencyProperty MinuteProperty = DependencyProperty.Register("Minutes", typeof(string), typeof(TimeLineControl));

		public string Minutes
		{
			get { return (string)GetValue(MinuteProperty); }
			set { SetValue(MinuteProperty, value); }
		}

		public TimeLineControl()
		{
			InitializeComponent();
			this.Loaded += new RoutedEventHandler(TimeLineControl_Loaded);
		}

		void TimeLineControl_Loaded(object sender, RoutedEventArgs e)
		{
			string minutes = Minutes;
			if (!string.IsNullOrEmpty(minutes))
			{
				string[] timesWord = minutes.Split(',');
				foreach (string item in timesWord)
				{
					switch (item.Trim())
					{
						case "0":
							Minute00.Visibility = System.Windows.Visibility.Visible;
							break;
						case "1":
							Minute01.Visibility = System.Windows.Visibility.Visible;
							break;
						case "2":
							Minute02.Visibility = System.Windows.Visibility.Visible;
							break;
						case "3":
							Minute03.Visibility = System.Windows.Visibility.Visible;
							break;
						case "4":
							Minute04.Visibility = System.Windows.Visibility.Visible;
							break;
						case "5":
							Minute05.Visibility = System.Windows.Visibility.Visible;
							break;
						case "6":
							Minute06.Visibility = System.Windows.Visibility.Visible;
							break;
						case "7":
							Minute07.Visibility = System.Windows.Visibility.Visible;
							break;
						case "8":
							Minute08.Visibility = System.Windows.Visibility.Visible;
							break;
						case "9":
							Minute09.Visibility = System.Windows.Visibility.Visible;
							break;

						case "10":
							Minute10.Visibility = System.Windows.Visibility.Visible;
							break;
						case "11":
							Minute11.Visibility = System.Windows.Visibility.Visible;
							break;
						case "12":
							Minute12.Visibility = System.Windows.Visibility.Visible;
							break;
						case "13":
							Minute13.Visibility = System.Windows.Visibility.Visible;
							break;
						case "14":
							Minute14.Visibility = System.Windows.Visibility.Visible;
							break;
						case "15":
							Minute15.Visibility = System.Windows.Visibility.Visible;
							break;
						case "16":
							Minute16.Visibility = System.Windows.Visibility.Visible;
							break;
						case "17":
							Minute17.Visibility = System.Windows.Visibility.Visible;
							break;
						case "18":
							Minute18.Visibility = System.Windows.Visibility.Visible;
							break;
						case "19":
							Minute19.Visibility = System.Windows.Visibility.Visible;
							break;

						case "20":
							Minute20.Visibility = System.Windows.Visibility.Visible;
							break;
						case "21":
							Minute21.Visibility = System.Windows.Visibility.Visible;
							break;
						case "22":
							Minute22.Visibility = System.Windows.Visibility.Visible;
							break;
						case "23":
							Minute23.Visibility = System.Windows.Visibility.Visible;
							break;
						case "24":
							Minute24.Visibility = System.Windows.Visibility.Visible;
							break;
						case "25":
							Minute25.Visibility = System.Windows.Visibility.Visible;
							break;
						case "26":
							Minute26.Visibility = System.Windows.Visibility.Visible;
							break;
						case "27":
							Minute27.Visibility = System.Windows.Visibility.Visible;
							break;
						case "28":
							Minute28.Visibility = System.Windows.Visibility.Visible;
							break;
						case "29":
							Minute29.Visibility = System.Windows.Visibility.Visible;
							break;

						case "30":
							Minute30.Visibility = System.Windows.Visibility.Visible;
							break;
						case "31":
							Minute31.Visibility = System.Windows.Visibility.Visible;
							break;
						case "32":
							Minute32.Visibility = System.Windows.Visibility.Visible;
							break;
						case "33":
							Minute33.Visibility = System.Windows.Visibility.Visible;
							break;
						case "34":
							Minute34.Visibility = System.Windows.Visibility.Visible;
							break;
						case "35":
							Minute35.Visibility = System.Windows.Visibility.Visible;
							break;
						case "36":
							Minute36.Visibility = System.Windows.Visibility.Visible;
							break;
						case "37":
							Minute37.Visibility = System.Windows.Visibility.Visible;
							break;
						case "38":
							Minute38.Visibility = System.Windows.Visibility.Visible;
							break;
						case "39":
							Minute39.Visibility = System.Windows.Visibility.Visible;
							break;

						case "40":
							Minute40.Visibility = System.Windows.Visibility.Visible;
							break;
						case "41":
							Minute41.Visibility = System.Windows.Visibility.Visible;
							break;
						case "42":
							Minute42.Visibility = System.Windows.Visibility.Visible;
							break;
						case "43":
							Minute43.Visibility = System.Windows.Visibility.Visible;
							break;
						case "44":
							Minute44.Visibility = System.Windows.Visibility.Visible;
							break;
						case "45":
							Minute45.Visibility = System.Windows.Visibility.Visible;
							break;
						case "46":
							Minute46.Visibility = System.Windows.Visibility.Visible;
							break;
						case "47":
							Minute47.Visibility = System.Windows.Visibility.Visible;
							break;
						case "48":
							Minute48.Visibility = System.Windows.Visibility.Visible;
							break;
						case "49":
							Minute49.Visibility = System.Windows.Visibility.Visible;
							break;

						case "50":
							Minute50.Visibility = System.Windows.Visibility.Visible;
							break;
						case "51":
							Minute51.Visibility = System.Windows.Visibility.Visible;
							break;
						case "52":
							Minute52.Visibility = System.Windows.Visibility.Visible;
							break;
						case "53":
							Minute53.Visibility = System.Windows.Visibility.Visible;
							break;
						case "54":
							Minute54.Visibility = System.Windows.Visibility.Visible;
							break;
						case "55":
							Minute55.Visibility = System.Windows.Visibility.Visible;
							break;
						case "56":
							Minute56.Visibility = System.Windows.Visibility.Visible;
							break;
						case "57":
							Minute57.Visibility = System.Windows.Visibility.Visible;
							break;
						case "58":
							Minute58.Visibility = System.Windows.Visibility.Visible;
							break;
						case "59":
							Minute59.Visibility = System.Windows.Visibility.Visible;
							break;

					}
				}
			}
		}
	}
}
